﻿using System;
using FBGraph.Models;

namespace FBGraph.Controllers
{
    public partial class LinksController
    {
        /// <summary>Posts a link on the specified profile.</summary>
        /// <param name="profileId">The Graph API identifier of the profile where the link will be posted.</param>
        /// <param name="link">A url.</param>
        /// <param name="message">A message to include with the url.</param>
        /// <returns>The Graph API identifier of the link that was posted.</returns>
        public Object Create(Object profileId, String link, String message)
        {
            var args = new FBArgs
            {
                { "link", link },
                { "message", message }
            };

            var result = Context.Post(profileId, "links", args);

            return result.Id;
        }
    }
}